<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
	<meta charset="UTF-8">
	<title>班级管理</title>
	
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<meta name="description" content="Responsive Admin &amp; Dashboard Template based on Bootstrap 5">
	<meta name="author" content="AdminKit">
	<meta name="keywords" content="adminkit, bootstrap, bootstrap 5, admin, dashboard, template, responsive, css, sass, html, theme, front-end, ui kit, web">
	
	<link rel="preconnect" href="https://fonts.gstatic.com">
	<link rel="shortcut icon" href="img/icons/icon-48x48.png" />
	
	<link rel="canonical" href="https://demo-basic.adminkit.io/pages-profile.html" />

	<link href="css/app.css" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
	<!----<script src="js/app.js"></script>------>
	
</head>

<body>

<div class="wrapper">
		<nav id="sidebar" class="sidebar js-sidebar">
			<div class="sidebar-content js-simplebar">
				<a class="sidebar-brand" href="index.html">
					<span class="align-middle">AdminKit</span>
				</a>

				<ul class="sidebar-nav">
					<li class="sidebar-header">
						Pages
					</li>

					<li class="sidebar-item">
						<a class="sidebar-link" href="index.html">
              <i class="align-middle" data-feather="sliders"></i> <span class="align-middle">Dashboard</span>
            </a>
					</li>

					<li class="sidebar-item active">
						<a class="sidebar-link" href="pages-profile.html">
              <i class="align-middle" data-feather="user"></i> <span class="align-middle">Profile</span>
            </a>
					</li>

					<li class="sidebar-item">
						<a class="sidebar-link" href="pages-sign-in.html">
              <i class="align-middle" data-feather="log-in"></i> <span class="align-middle">Sign In</span>
            </a>
					</li>

					<li class="sidebar-item">
						<a class="sidebar-link" href="pages-sign-up.html">
              <i class="align-middle" data-feather="user-plus"></i> <span class="align-middle">Sign Up</span>
            </a>
					</li>

					<li class="sidebar-item">
						<a class="sidebar-link" href="pages-blank.html">
              <i class="align-middle" data-feather="book"></i> <span class="align-middle">Blank</span>
            </a>
					</li>

					<li class="sidebar-header">
						Tools & Components
					</li>

					<li class="sidebar-item">
						<a class="sidebar-link" href="ui-buttons.html">
              <i class="align-middle" data-feather="square"></i> <span class="align-middle">Buttons</span>
            </a>
					</li>

					<li class="sidebar-item">
						<a class="sidebar-link" href="ui-forms.html">
              <i class="align-middle" data-feather="check-square"></i> <span class="align-middle">Forms</span>
            </a>
					</li>

					<li class="sidebar-item">
						<a class="sidebar-link" href="ui-cards.html">
              <i class="align-middle" data-feather="grid"></i> <span class="align-middle">Cards</span>
            </a>
					</li>

					<li class="sidebar-item">
						<a class="sidebar-link" href="ui-typography.html">
              <i class="align-middle" data-feather="align-left"></i> <span class="align-middle">Typography</span>
            </a>
					</li>

					<li class="sidebar-item">
						<a class="sidebar-link" href="icons-feather.html">
              <i class="align-middle" data-feather="coffee"></i> <span class="align-middle">Icons</span>
            </a>
					</li>

					<li class="sidebar-header">
						Plugins & Addons
					</li>

					<li class="sidebar-item">
						<a class="sidebar-link" href="charts-chartjs.html">
              <i class="align-middle" data-feather="bar-chart-2"></i> <span class="align-middle">Charts</span>
            </a>
					</li>

					<li class="sidebar-item">
						<a class="sidebar-link" href="maps-google.html">
              <i class="align-middle" data-feather="map"></i> <span class="align-middle">Maps</span>
            </a>
					</li>
				</ul>

				<div class="sidebar-cta">
					<div class="sidebar-cta-content">
						<strong class="d-inline-block mb-2">Upgrade to Pro</strong>
						<div class="mb-3 text-sm">
							Are you looking for more components? Check out our premium version.
						</div>
						<div class="d-grid">
							<a href="upgrade-to-pro.html" class="btn btn-primary">Upgrade to Pro</a>
						</div>
					</div>
				</div>
			</div>
		</nav>

		<div class="main">
			<!--顶层信息栏--->
			<nav class="navbar navbar-expand navbar-light navbar-bg">
				<!--伸缩三横杠--->
				<a class="sidebar-toggle js-sidebar-toggle">
					<i class="hamburger align-self-center"></i>
				</a>
				<!--右侧信息栏--->
				<div class="navbar-collapse collapse">
					<ul class="navbar-nav navbar-align">
						<li class="nav-item dropdown">
							<!--不知道是什么，没删-->
							<a class="nav-icon dropdown-toggle d-inline-block d-sm-none" href="#" data-bs-toggle="dropdown">
								<i class="align-middle" data-feather="settings"></i>
							</a>

							<a class="nav-link dropdown-toggle d-none d-sm-inline-block" href="#" data-bs-toggle="dropdown">
								<!--右上角信息，老师学生管理员--->
								<span th:if="${usertype} eq '0'">
									<span th:each="i:${teacherinfo}">
										<img th:src="@{${i.headshot}}" onerror="this.src='images/class/classheadshot/15.png'" class="avatar img-fluid rounded me-1" alt="教师" />
										<span class="text-dark"><span th:text="${i.username}"></span></span>
									</span>
								</span>
								<span th:if="${usertype} eq '1'">
									<span th:each="i:${studentinfo}">
										<img th:src="@{${i.userheadshot}}" onerror="this.src='images/class/classheadshot/15.png'" class="avatar img-fluid rounded me-1" alt="学生" />
										<span class="text-dark"><span th:text="${i.username}"></span></span>
									</span>
								</span>
								<span th:if="${usertype} eq '2'">
									<span th:each="i:${admininfo}">
										<img src="images/class/classheadshot/15.png'" class="avatar img-fluid rounded me-1" alt="管理员" />
										<span class="text-dark"><span th:text="${i.username}"></span></span>
									</span>
								</span>							
							</a>
							<!--下拉栏，没写，全静态无所谓--->
							<div class="dropdown-menu dropdown-menu-end">
								<a class="dropdown-item" href="#"><i class="align-middle me-1" data-feather="user"></i> Profile</a>
								<a class="dropdown-item" href="#"><i class="align-middle me-1" data-feather="pie-chart"></i> Analytics</a>
								<div class="dropdown-divider"></div>
								<a class="dropdown-item" href="#"><i class="align-middle me-1" data-feather="settings"></i> Settings</a>
								<a class="dropdown-item" href="#"><i class="align-middle me-1" data-feather="help-circle"></i> Help Center</a>
								<div class="dropdown-divider"></div>
								<a class="dropdown-item" href="#">Log out</a>
							</div>
						</li>
					</ul>
				</div>
			</nav>
		
			<!--主要内容栏--->			
			<main class="content">
				<div class="container-fluid p-0">		
					<div class="row">
						<!-- 老师添加课程----->
						<div class="col-12 col-lg-6">
							<!-- 老师添加课程--->
							<div th:if="${usertype} eq '0'">
								<form class="row g-3" action="/upclass" enctype='multipart/form-data' method='POST'>
									<div class="card">
										<div class="card-header">
											<h3 class="card-title mb-0">创建新班级</h3>
										</div>
										<div class="card-body row">
											<div class="col-6  mb-3">
												<label for="class1" class="form-label">班级名称</label>
												<input type="text" name="classname" class="form-control" id="class1" placeholder="请输入班级名称-必填项">
											</div>
											<div class="col-6  mb-3">
												<label for="class2" class="form-label">班级类型</label>
												<input type="text" name="classtype" class="form-control" id="class2" placeholder="请输入班级类型-必填项">
											</div>
											<div class="col-12  mb-3">
												<label for="class3" class="form-label">班级简介</label>
												<textarea class="form-control" name="information" id="class3" rows="1" placeholder="请输入班级简介-选填项"></textarea>
											</div>
											<div class="col-8  mb-3">
												<label for="class4" class="form-label">班级封面</label>
												<input class="form-control" type="file" name="picture"id="class4">
											</div>
											<div class="col-4  mb-3">
												<label for="class5" class="form-label">点击按钮完成创建</label>
												<button type="submit" name="create" class="btn btn-primary col-12">创建班级</button>
											</div>
										</div>
									</div>
								</form>
							</div>
						</div>	
						<!--老师搜索，竖着排-->
						<div class="col-12 col-lg-6">
							<div  th:if="${usertype} eq '0'">
								<form class="row g-3" action="/searchclass" enctype='multipart/form-data' method='POST'>
									<div class="card">
										<div class="card-header">
											<h3 class="card-title mb-0">搜索班级</h3>
										</div>
										<div class="card-body row">
											<div class="col-4  mb-3">
												<label for="class1" class="form-label">班级编号</label>
												<input class="form-control" type="text" placeholder="请输入班号" name="classid" id="class1">
											</div>
											<div class="col-4  mb-3">
												<label for="class2" class="form-label">班级名称</label>
												<input class="form-control" type="text" placeholder="请输入班名" name="classname"  id="class2">
											</div>
											<div class="col-4  mb-3">
												<label for="class3" class="form-label">班级类型</label>
												<input class="form-control" type="text" placeholder="请输入类型" name="classtype"  id="class3">
											</div>
											<div class="col-6  mb-3">
												<label for="class4" class="form-label">老师邮箱</label>
												<input class="form-control" type="text" placeholder="请输入邮箱" name="teachermail"  id="class4">
											</div>
											<div class="col-6  mb-3">
												<label for="class5" class="form-label">班级状态</label>
												<select id="class5" class="form-select" name="state">
													<option selected="selected">选择下列其中一个班级状态----</option>
													<option th:if="${usertype} ne '1'" value=0>未审核</option>
													<option th:if="${usertype} ne '1'" value=1>审核未通过</option>
													<option value=2>审核通过进行中</option>
													<option value=3>申请结课中</option>
													<option value=4>已结课</option>
												</select>
											</div>
											<div class="col-6  mb-3">
												<label for="class6" class="form-label">搜索模式</label>
												<select id="class6" class="form-select" name="stype">
													<option selected="selected">根据您的输入选择对应搜索模式</option>
													<option value=0>根据班级编号搜索</option>
													<option value=1>根据班级名称搜索</option>
													<option value=2>根据班级类型搜索</option>
													<option value=3>根据老师邮箱搜索</option>
													<option value=4>根据班级状态搜索</option>
													<option value=5>精准搜索（输入完整信息）</option>
													<option value=6>显示全部（无需输入信息）</option>
												</select>
											</div>
											<div class="col-6 justify-content-md-end">
												<input type="hidden" name="searchtype" value="1">
												<label class="form-label">点击按钮开始搜索</label>
												<button type="submit" name="create" class="btn btn-primary col-12">搜索</button>
											</div>
										</div>
									</div>
								</form>
							</div>
						</div>
						<!--学生和管理员搜索，横着排-->
						<div class="col-12">
							<div  th:if="${usertype} ne '0'">
								<form class="row g-3" action="/searchclass" enctype='multipart/form-data' method='POST'>
									<div class="card">
										<div class="card-header">
											<h5 class="card-title mb-0">搜索班级</h5>
										</div>
										<div class="card-body row">
											<div class="col-2 mb-3">
												<label for="class1" class="form-label">班级编号</label>
												<input class="form-control" type="text" placeholder="请输入班号" name="classid" id="class1">
											</div>
											<div class="col-2  mb-3">
												<label for="class2" class="form-label">班级名称</label>
												<input class="form-control" type="text" placeholder="请输入班名" name="classname"  id="class2">
											</div>
											<div class="col-2  mb-3">
												<label for="class3" class="form-label">班级类型</label>
												<input class="form-control" type="text" placeholder="请输入类型" name="classtype"  id="class3">
											</div>
											<div class="col-6   mb-3">
												<label for="class4" class="form-label">老师邮箱</label>
												<input class="form-control" type="text" placeholder="请输入邮箱" name="teachermail"  id="class4">
											</div>
											<div class="col-5  mb-3">
												<label for="class5" class="form-label">班级状态</label>
												<select id="class5" class="form-select" name="state">
													<option selected="selected">选择下列其中一个班级状态----</option>
													<option th:if="${usertype} ne '1'" value=0>未审核</option>
													<option th:if="${usertype} ne '1'" value=1>审核未通过</option>
													<option value=2>审核通过进行中</option>
													<option value=3>申请结课中</option>
													<option value=4>已结课</option>
												</select>
											</div>
											<div class="col-5 mb-3">
												<label for="class6" class="form-label">搜索模式</label>
												<select id="class6" class="form-select" name="stype">
													<option selected="selected">根据您的输入选择对应搜索模式</option>
													<option value=0>根据班级编号搜索</option>
													<option value=1>根据班级名称搜索</option>
													<option value=2>根据班级类型搜索</option>
													<option value=3>根据老师邮箱搜索</option>
													<option value=4>根据班级状态搜索</option>
													<option value=5>精准搜索（输入完整信息）</option>
													<option value=6>显示全部（无需输入信息）</option>
												</select>
											</div>
											<div class="col-2  mb-3 ">
												<input type="hidden" name="searchtype" value="1">
												<label class="form-label">点击按钮开始搜索</label>
												<button type="submit" name="create" class="btn btn-primary col-12">搜索</button>
											</div>
										</div>
									</div>
								</form>
							</div>
						</div>
						
						<div class="col-12 mb-3">
							<h1 class="h3 d-inline align-middle">班级详情展示</h1>
							<a class="badge bg-dark text-white ms-2" href="help.html">Get more tips</a>
						</div>
						
						<!-- 老师，学生，管理员默认课程信息展示 -->
						<div class="col-4 col-lg-3" th:each="i:${classinfo}" th:if="${searchtype} eq '0'">
							<div class="card">
								<div class="card-header">
									<h5 class="card-title mb-0" th:text="${i.classname}"></h5>
								</div>
								<div class="card-body text-center row">
									<img th:src="@{${i.picture}}" onerror="this.src='images/class/classheadshot/15.png'" alt="班级封面" class="img-fluid rounded-circle mb-2" width="128" height="128" />
									<h5 class="card-title mb-0" th:text="${i.classid}"></h5>
									<div class="text-muted mb-2" th:text="${i.classtype}"></div>
									<div class="text-muted mb-2">
										<div th:if="${i.state} eq '0'">未审核</div>
										<div th:if="${i.state} eq '1'">审核未通过</div>
										<div th:if="${i.state} eq '2'">审核通过进行中</div>
										<div th:if="${i.state} eq '3'">结课申请审核中</div>
										<div th:if="${i.state} eq '4'">结课</div>									
									</div>
									<div class="text-muted mb-2" th:if="${usertype} ne '0'">
										<div th:text="${i.teachermail}"></div>								
									</div>
									<!--按钮的模块-->
									<!---查看详情按钮--->
									<form class="col-6 mb-3 mx-auto" action="/checkclass" enctype='multipart/form-data' method='POST'>
										<button type="submit" name="create" class="btn btn-primary">查看详情</button>
										<input type="hidden" name="searchtype" th:value="0">
										<input type="hidden" name="classid" th:value="${i.classid}">
									</form>
									<!--按钮，所有课程都只可能有一个关于状态修改的按钮，无论是管理员还是老师-->
									<div th:if="${usertype} eq '0'" class="col-6 mb-3 mx-auto">
										<div th:if="${i.state} le '1'">
											<form action="/shenheclass" enctype='multipart/form-data' method='POST'>
												<button type="submit" name="create" class="btn btn-primary">申请重审</button>
												<input type="hidden" name="searchtype" th:value="0">
												<input type="hidden" name="classid" th:value="${i.classid}">
											</form>
										</div>
										<div th:if="${i.state} eq '2'">
											<form action="/endclass" enctype='multipart/form-data' method='POST'>
												<button type="submit" name="create" class="btn btn-primary">申请结课</button>
												<input type="hidden" name="searchtype" th:value="0">
												<input type="hidden" name="classid" th:value="${i.classid}">
											</form>
										</div>
									</div>
									<div th:if="${usertype} eq '2'" class="col-6 mb-3 mx-auto">
										<div th:if="${i.state} le '1'">
											<form action="/shenheclass" enctype='multipart/form-data' method='POST'>
															<select class="form-select" name="stypey">
																<option selected="selected">选择审核结果</option>
																<option value=0>不通过</option>
																<option value=1>通过</option>
															</select>
															<button type="submit" class="btn btn-primary">提交审核</button>
															<input type="hidden" name="searchtype" th:value="0">
															<input type="hidden" name="classid" th:value="${i.classid}">
														</form>
										</div>
										<div th:if="${i.state} eq '3'">
											<form action="/endclass" enctype='multipart/form-data' method='POST'>
												<button type="submit" class="btn btn-primary">允许结课</button>
												<input type="hidden" name="searchtype" th:value="0">
												<input type="hidden" name="classid" th:value="${i.classid}">
											</form>
										</div>										
									</div>
									<hr class="my-0" />
									<div class="card-body">
										<h5 class="h6 card-title">班级简介</h5>
										<div class="text-muted" th:text="${i.information}"></div>
									</div>
								</div>
							</div>
						</div>
						<!-- 老师，学生，管理员搜索课程信息展示 -->
						<div class="col-4 col-lg-3" th:each="i:${classinfo1}" th:if="${searchtype} eq '1'">
							<div class="card" th:if="${usertype} ne '1'">
								<div class="card-header">
									<h5 class="card-title mb-0" th:text="${i.classname}"></h5>
								</div>
								<div class="card-body text-center row">
									<img th:src="@{${i.picture}}" onerror="this.src='images/class/classheadshot/15.png'" alt="班级封面" class="img-fluid rounded-circle mb-2" width="128" height="128" />
									<h5 class="card-title mb-0" th:text="${i.classid}"></h5>
									<div class="text-muted mb-2" th:text="${i.classtype}"></div>
									<div class="text-muted mb-2">
										<div th:if="${i.state} eq '0'">未审核</div>
										<div th:if="${i.state} eq '1'">审核未通过</div>
										<div th:if="${i.state} eq '2'">审核通过进行中</div>
										<div th:if="${i.state} eq '3'">结课申请审核中</div>
										<div th:if="${i.state} eq '4'">结课</div>									
									</div>
									<div class="text-muted mb-2" th:text="${i.teachermail}"></div>
									<!--按钮的模块-->
									<!---查看详情按钮--->
									<form class="col-6 mb-3" action="/checkclass" enctype='multipart/form-data' method='POST'>
										<button type="submit" name="create" class="btn btn-primary">查看详情</button>
										<input type="hidden" name="searchtype" th:value="1">
										<input type="hidden" name="classid" th:value="${i.classid}">
									</form>
									<!--按钮，所有课程都只可能有一个关于状态修改的按钮，无论是管理员还是老师-->
									<!-- 老师 -->
									<div th:if="${usertype} eq '0'" class="col-6 mb-3" >
										<div th:if="${eqmail[__${iStat.index}__] eq '1'}">
											<div th:if="${i.state} le '1'">
												<form action="/shenheclass" enctype='multipart/form-data' method='POST'>
													<button type="submit" class="btn btn-primary">申请重审</button>
													<input type="hidden" name="searchtype" th:value="1">
													<input type="hidden" name="classid" th:value="${i.classid}">
												</form>
											</div>
											<div th:if="${i.state} eq '2'">
												<form action="/endclass" enctype='multipart/form-data' method='POST'>
													<button type="submit" class="btn btn-primary">申请结课</button>
													<input type="hidden" name="searchtype" th:value="1">
													<input type="hidden" name="classid" th:value="${i.classid}">
												</form>
											</div>
										</div>
									</div>
									
									<!-- 管理员 -->
									<div th:if="${usertype} eq '2'" class="col-6 mb-3">
										<div th:if="${i.state} le '1'">
											<form action="/shenheclass" enctype='multipart/form-data' method='POST'>
												<select class="form-select" name="stypey">
													<option selected="selected">选择审核结果</option>
													<option value="0">不通过</option>
													<option value="1">通过</option>
												</select>
												<button type="submit" class="btn btn-primary">提交审核</button>
												<input type="hidden" name="searchtype" th:value="1">
												<input type="hidden" name="classid" th:value="${i.classid}">
											</form>
										</div>
										<div th:if="${i.state} eq '3'">
											<form action="/endclass" enctype='multipart/form-data' method='POST'>
												<button type="submit" class="btn btn-primary">允许结课</button>
												<input type="hidden" name="searchtype" th:value="1">
												<input type="hidden" name="classid" th:value="${i.classid}">
											</form>
										</div>										
									</div>
									
									<hr class="my-0" />
									<div class="card-body">
										<h5 class="h6 card-title">班级简介</h5>
										<div class="text-muted" th:text="${i.information}"></div>
									</div>
								</div>
							</div>
							<!-- 学生 -->
							<div th:if="${usertype} eq '1'">
								<div class="card" th:if="${i.state} ge '2'">
									<div class="card-header">
										<h5 class="card-title mb-0" th:text="${i.classname}"></h5>
									</div>
									<div class="card-body text-center row">
										<img th:src="@{${i.picture}}" onerror="this.src='images/class/classheadshot/15.png'" alt="班级封面" class="img-fluid rounded-circle mb-2" width="128" height="128" />
										<h5 class="card-title mb-0" th:text="${i.classid}"></h5>
										<div class="text-muted mb-2" th:text="${i.classtype}"></div>
										<div class="text-muted mb-2">
											<div th:if="${i.state} eq '2'">审核通过进行中</div>
											<div th:if="${i.state} eq '3'">结课申请审核中</div>
											<div th:if="${i.state} eq '4'">结课</div>									
										</div>
										<div class="text-muted mb-2" th:text="${i.teachermail}"></div>
										<!--按钮的模块-->
										<!---查看详情按钮--->
										<form class="col-6 mb-3" action="/checkclass" enctype='multipart/form-data' method='POST'>
											<button type="submit" class="btn btn-primary">查看详情</button>
											<input type="hidden" name="searchtype" th:value="1">
											<input type="hidden" name="classid" th:value="${i.classid}">
										</form>
										<!--按钮，加入课程，判断是否已经加入，已经加入不展示加入班级按钮-->
										<form  class="col-6 mb-3" action="/joinclass" enctype='multipart/form-data' method='POST' th:if="${joinclass[iStat.index]} eq '0'">
											<div th:if="${i.state} eq '2'">
												<button type="submit" class="btn btn-primary">加入班级</button>
												<input type="hidden" name="searchtype" th:value="1">
												<input type="hidden" name="classid" th:value="${i.classid}">
											</div>
										</form>
										<hr class="my-0"/>
										<div class="card-body">
											<h5 class="h6 card-title">班级简介</h5>
											<div class="text-muted" th:text="${i.information}"></div>
										</div>
									</div>
								</div>
							
							</div>
						</div>
						
					</div>
				</div>
			</main>
		</div>
</div>

<script src="js/app.js"></script>

</body>
</html>